<?php

/**
 * Vuelo form base class.
 *
 * @method Vuelo getObject() Returns the current form's model object
 *
 * @package    aeropostal
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseVueloForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'           => new sfWidgetFormInputHidden(),
      'matricula'    => new sfWidgetFormPropelChoice(array('model' => 'Aeronave', 'add_empty' => false, 'key_method' => 'getMatricula')),
      'num_Vuelo'    => new sfWidgetFormInputText(),
      'nomb_Capitan' => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'id'           => new sfValidatorChoice(array('choices' => array($this->getObject()->getId()), 'empty_value' => $this->getObject()->getId(), 'required' => false)),
      'matricula'    => new sfValidatorPropelChoice(array('model' => 'Aeronave', 'column' => 'matricula')),
      'num_Vuelo'    => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647)),
      'nomb_Capitan' => new sfValidatorString(array('max_length' => 255)),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorPropelUnique(array('model' => 'Vuelo', 'column' => array('num_Vuelo')))
    );

    $this->widgetSchema->setNameFormat('vuelo[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Vuelo';
  }


}
